﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using admin.ServiceReference1;
using System.Windows.Browser;

namespace admin.two
{
    public partial class Insdata : UserControl
    {
        Service1Client sc;

        public Insdata()
        {
            InitializeComponent();
            this.Loaded += new RoutedEventHandler(Insdata_Loaded);
            this.bt_ins.Click += new RoutedEventHandler(bt_ins_Click);
        }

        void Insdata_Loaded(object sender, RoutedEventArgs e)
        {
            sc = serverManager.getPox();
            sc.insdataCompleted += new EventHandler<insdataCompletedEventArgs>(sc_insdataCompleted);
        }

        void sc_insdataCompleted(object sender, insdataCompletedEventArgs e)
        {
            bool sum = e.Result;
            if (sum)
            {
                MessageBox.Show("初始化成功");
            }
            else
            {
                MessageBox.Show("初始化失败");
            }
        }

        void bt_ins_Click(object sender, RoutedEventArgs e)
        {
            sc.insdataAsync();
        }
    }
}
